rem
	####################################################################
	
	Bullet Physics
	
	####################################################################
endrem
SuperStrict

rem
bbdoc: SEDM.bullet
endrem
Module sedm.bullet

ModuleInfo "Name: sedm.bullet"
ModuleInfo "Description: Wrapper for the Bullet Physics Engine"
ModuleInfo "Licence: see Bullet License"
ModuleInfo "Author: Jens [bruZard] Henschel"

Import brl.linkedlist
Import brl.filesystem
Import sedm.std

Import "bullet.lib"

?Win32
Extern "win32"
	' global functions
	Function _initBullet:Byte ptr(gravX:Float, gravY:Float, gravZ:Float)							' returns a Pointer to bBullet Class Object
	Function _shutDownBullet(bullet:Byte ptr)														' deletes all Bullet Resources
	Function _getDynamicsWorld:Byte ptr(bullet:Byte ptr)											' returns a Pointer to btDiscreteDynamicsWorld Class Object
	Function _updateBullet(bullet:Byte ptr, timeStep:Float,maxSubSteps:Int, fixedTimeStep:Float)	' updates the simulation
	
	' rigid body functions
	Function _createRigidBody:Byte ptr(bullet:Byte ptr, typ:Int, mass:Float, playerControlled:Int, rbsize:Byte ptr, rbpos:Byte ptr)	' returns a pointer to bRigidBody class object
	Function _removeRigidBodyFromWorld(bullet:Byte ptr, body:Byte ptr)								' removes the rigidbody frpm dynamicsworld
	Function _deleteRigidBody(bullet:Byte ptr, body:Byte ptr)										' deletes the rigidbody
	Function _getRigidBodyPosition(body:Byte ptr, vec:Byte ptr)										' returns a pointer to bVector3 class object
	Function _setRigidBodyPosition(rigidBody:Byte ptr, rbpos:Byte ptr)								' set the rigidbody position
	Function _getRigidBodyRotation(body:Byte ptr, quat:Byte ptr)									' returns a pointer to bQuaternion class object
	Function _userControlledBody(body:Byte ptr)														' Body not affected by other rigidBodies
	Function _translateRigidBody(body:Byte ptr, x:Float, y:Float, z:Float)							' translate the Boy
	Function _pitchRigidBody(body:Byte ptr, x:Float)
	Function _yawRigidBody(body:Byte ptr, y:Float)
	Function _rollRigidBody(body:Byte ptr, z:Float)
End Extern
?

Include "include/header.bmx"
Include "include/bullet_main.bmx"
Include "include/rigidbody.bmx"
